
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>基础类型 · TypeScript Handbook</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="Patrick Zhong">
        
        
    
    <link rel="stylesheet" href="../../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="Variable Declarations.html" />
    
    
    <link rel="prev" href="./" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../../">
            
                <a href="../../">
            
                    
                    Introduction
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="tutorials/">
            
                <a href="tutorials/">
            
                    
                    快速上手
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="tutorials/TypeScript in 5 minutes.html">
            
                <a href="tutorials/TypeScript in 5 minutes.html">
            
                    
                    5分钟了解TypeScript
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="tutorials/ASP.NET Core.html">
            
                <a href="tutorials/ASP.NET Core.html">
            
                    
                    ASP.NET Core
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3" data-path="tutorials/ASP.NET 4.html">
            
                <a href="tutorials/ASP.NET 4.html">
            
                    
                    ASP.NET 4
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.4" data-path="tutorials/Gulp.html">
            
                <a href="tutorials/Gulp.html">
            
                    
                    Gulp
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.5" data-path="tutorials/Knockout.html">
            
                <a href="tutorials/Knockout.html">
            
                    
                    Knockout.js
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.6" data-path="tutorials/React & Webpack.html">
            
                <a href="tutorials/React & Webpack.html">
            
                    
                    React与webpack
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.7" data-path="tutorials/React.html">
            
                <a href="tutorials/React.html">
            
                    
                    React
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.8" data-path="tutorials/Angular 2.html">
            
                <a href="tutorials/Angular 2.html">
            
                    
                    Angular 2
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.9" data-path="tutorials/Migrating from JavaScript.html">
            
                <a href="tutorials/Migrating from JavaScript.html">
            
                    
                    从JavaScript迁移到TypeScript
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="./">
            
                <a href="./">
            
                    
                    手册
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter active" data-level="1.3.1" data-path="Basic Types.html">
            
                <a href="Basic Types.html">
            
                    
                    基础类型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="Variable Declarations.html">
            
                <a href="Variable Declarations.html">
            
                    
                    变量声明
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="Interfaces.html">
            
                <a href="Interfaces.html">
            
                    
                    接口
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.4" data-path="Classes.html">
            
                <a href="Classes.html">
            
                    
                    类
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.5" data-path="Functions.html">
            
                <a href="Functions.html">
            
                    
                    函数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.6" data-path="Generics.html">
            
                <a href="Generics.html">
            
                    
                    泛型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.7" data-path="Enums.html">
            
                <a href="Enums.html">
            
                    
                    枚举
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.8" data-path="Type Inference.html">
            
                <a href="Type Inference.html">
            
                    
                    类型推论
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.9" data-path="Type Compatibility.html">
            
                <a href="Type Compatibility.html">
            
                    
                    类型兼容性
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.10" data-path="Advanced Types.html">
            
                <a href="Advanced Types.html">
            
                    
                    高级类型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.11" data-path="Utilit Types.md">
            
                <span>
            
                    
                    实用工具类型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.12" data-path="Symbols.html">
            
                <a href="Symbols.html">
            
                    
                    Symbols
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.13" data-path="Iterators and Generators.html">
            
                <a href="Iterators and Generators.html">
            
                    
                    Iterators 和 Generators
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.14" data-path="Modules.html">
            
                <a href="Modules.html">
            
                    
                    模块
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.15" data-path="Namespaces.html">
            
                <a href="Namespaces.html">
            
                    
                    命名空间
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.16" data-path="Namespaces and Modules.html">
            
                <a href="Namespaces and Modules.html">
            
                    
                    命名空间和模块
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.17" data-path="Module Resolution.html">
            
                <a href="Module Resolution.html">
            
                    
                    模块解析
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.18" data-path="Declaration Merging.html">
            
                <a href="Declaration Merging.html">
            
                    
                    声明合并
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.19" data-path="Writing Definition Files.html">
            
                <a href="Writing Definition Files.html">
            
                    
                    书写.d.ts文件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.20" data-path="JSX.html">
            
                <a href="JSX.html">
            
                    
                    JSX
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.21" data-path="Decorators.html">
            
                <a href="Decorators.html">
            
                    
                    Decorators
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.22" data-path="Mixins.html">
            
                <a href="Mixins.html">
            
                    
                    混入
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.23" data-path="Triple-Slash Directives.html">
            
                <a href="Triple-Slash Directives.html">
            
                    
                    三斜线指令
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.24" data-path="Type Checking JavaScript Files.html">
            
                <a href="Type Checking JavaScript Files.html">
            
                    
                    JavaScript文件里的类型检查
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="declaration files/Introduction.html">
            
                <a href="declaration files/Introduction.html">
            
                    
                    如何书写声明文件
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="declaration files/Library Structures.html">
            
                <a href="declaration files/Library Structures.html">
            
                    
                    结构
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="declaration files/Do's and Don'ts.html">
            
                <a href="declaration files/Do's and Don'ts.html">
            
                    
                    规范
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="declaration files/By Example.html">
            
                <a href="declaration files/By Example.html">
            
                    
                    举例
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.4" data-path="declaration files/Deep Dive.html">
            
                <a href="declaration files/Deep Dive.html">
            
                    
                    深入
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.5" data-path="declaration files/Publishing.html">
            
                <a href="declaration files/Publishing.html">
            
                    
                    发布
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.6" data-path="declaration files/Consumption.html">
            
                <a href="declaration files/Consumption.html">
            
                    
                    使用
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="tsconfig.json.html">
            
                <a href="tsconfig.json.html">
            
                    
                    工程配置
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="tsconfig.json.html">
            
                <a href="tsconfig.json.html">
            
                    
                    tsconfig.json
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="Project References.html">
            
                <a href="Project References.html">
            
                    
                    工程引用
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.3" data-path="Typings for NPM Packages.html">
            
                <a href="Typings for NPM Packages.html">
            
                    
                    NPM包的类型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.4" data-path="Compiler Options.html">
            
                <a href="Compiler Options.html">
            
                    
                    编译选项
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.5" data-path="Configuring Watch.html">
            
                <a href="Configuring Watch.html">
            
                    
                    配置 Watch
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.6" data-path="Compiler Options in MSBuild.html">
            
                <a href="Compiler Options in MSBuild.html">
            
                    
                    在MSBuild里使用编译选项
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.7" data-path="Integrating with Build Tools.html">
            
                <a href="Integrating with Build Tools.html">
            
                    
                    与其它构建工具整合
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.8" data-path="Nightly Builds.html">
            
                <a href="Nightly Builds.html">
            
                    
                    使用TypeScript的每日构建版本
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="../wiki/">
            
                <a href="../wiki/">
            
                    
                    Wiki
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="../wiki/this-in-TypeScript.html">
            
                <a href="../wiki/this-in-TypeScript.html">
            
                    
                    TypeScript里的this
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="../wiki/coding_guidelines.html">
            
                <a href="../wiki/coding_guidelines.html">
            
                    
                    编码规范
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.3" data-path="../wiki/Common Errors.html">
            
                <a href="../wiki/Common Errors.html">
            
                    
                    常见编译错误
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.4" data-path="../wiki/TypeScript-Editor-Support.html">
            
                <a href="../wiki/TypeScript-Editor-Support.html">
            
                    
                    支持TypeScript的编辑器
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.5" data-path="../wiki/Using-TypeScript-With-ASP.NET-5.html">
            
                <a href="../wiki/Using-TypeScript-With-ASP.NET-5.html">
            
                    
                    结合ASP.NET v5使用TypeScript
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.6" data-path="../wiki/Architectural-Overview.html">
            
                <a href="../wiki/Architectural-Overview.html">
            
                    
                    架构概述
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.7" data-path="../wiki/Roadmap.html">
            
                <a href="../wiki/Roadmap.html">
            
                    
                    发展路线图
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="../release-notes/">
            
                <a href="../release-notes/">
            
                    
                    新增功能
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="../release-notes/TypeScript 3.1.html">
            
                <a href="../release-notes/TypeScript 3.1.html">
            
                    
                    TypeScript 3.1
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2" data-path="../release-notes/TypeScript 3.0.html">
            
                <a href="../release-notes/TypeScript 3.0.html">
            
                    
                    TypeScript 3.0
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3" data-path="../release-notes/TypeScript 2.9.html">
            
                <a href="../release-notes/TypeScript 2.9.html">
            
                    
                    TypeScript 2.9
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.4" data-path="../release-notes/TypeScript 2.8.html">
            
                <a href="../release-notes/TypeScript 2.8.html">
            
                    
                    TypeScript 2.8
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.5" data-path="../release-notes/TypeScript 2.7.html">
            
                <a href="../release-notes/TypeScript 2.7.html">
            
                    
                    TypeScript 2.7
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.6" data-path="../release-notes/TypeScript 2.6.html">
            
                <a href="../release-notes/TypeScript 2.6.html">
            
                    
                    TypeScript 2.6
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.7" data-path="../release-notes/TypeScript 2.5.html">
            
                <a href="../release-notes/TypeScript 2.5.html">
            
                    
                    TypeScript 2.5
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.8" data-path="../release-notes/TypeScript 2.4.html">
            
                <a href="../release-notes/TypeScript 2.4.html">
            
                    
                    TypeScript 2.4
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.9" data-path="../release-notes/TypeScript 2.3.html">
            
                <a href="../release-notes/TypeScript 2.3.html">
            
                    
                    TypeScript 2.3
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.10" data-path="../release-notes/TypeScript 2.2.html">
            
                <a href="../release-notes/TypeScript 2.2.html">
            
                    
                    TypeScript 2.2
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.11" data-path="../release-notes/TypeScript 2.1.html">
            
                <a href="../release-notes/TypeScript 2.1.html">
            
                    
                    TypeScript 2.1
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.12" data-path="../release-notes/TypeScript 2.0.html">
            
                <a href="../release-notes/TypeScript 2.0.html">
            
                    
                    TypeScript 2.0
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.13" data-path="../release-notes/TypeScript 1.8.html">
            
                <a href="../release-notes/TypeScript 1.8.html">
            
                    
                    TypeScript 1.8
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.14" data-path="../release-notes/TypeScript 1.7.html">
            
                <a href="../release-notes/TypeScript 1.7.html">
            
                    
                    TypeScript 1.7
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.15" data-path="../release-notes/TypeScript 1.6.html">
            
                <a href="../release-notes/TypeScript 1.6.html">
            
                    
                    TypeScript 1.6
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.16" data-path="../release-notes/TypeScript 1.5.html">
            
                <a href="../release-notes/TypeScript 1.5.html">
            
                    
                    TypeScript 1.5
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.17" data-path="../release-notes/TypeScript 1.4.html">
            
                <a href="../release-notes/TypeScript 1.4.html">
            
                    
                    TypeScript 1.4
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.18" data-path="../release-notes/TypeScript 1.3.html">
            
                <a href="../release-notes/TypeScript 1.3.html">
            
                    
                    TypeScript 1.3
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.19" data-path="../release-notes/TypeScript 1.1.html">
            
                <a href="../release-notes/TypeScript 1.1.html">
            
                    
                    TypeScript 1.1
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="../breaking-changes/breaking-changes.html">
            
                <a href="../breaking-changes/breaking-changes.html">
            
                    
                    Breaking Changes
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.8.1" data-path="../breaking-changes/TypeScript 2.4.html">
            
                <a href="../breaking-changes/TypeScript 2.4.html">
            
                    
                    TypeScript 2.4
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.2" data-path="../breaking-changes/TypeScript 2.3.html">
            
                <a href="../breaking-changes/TypeScript 2.3.html">
            
                    
                    TypeScript 2.3
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.3" data-path="../breaking-changes/TypeScript 2.2.html">
            
                <a href="../breaking-changes/TypeScript 2.2.html">
            
                    
                    TypeScript 2.2
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.4" data-path="../breaking-changes/TypeScript 2.1.html">
            
                <a href="../breaking-changes/TypeScript 2.1.html">
            
                    
                    TypeScript 2.1
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.5" data-path="../breaking-changes/TypeScript 2.0.html">
            
                <a href="../breaking-changes/TypeScript 2.0.html">
            
                    
                    TypeScript 2.0
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.6" data-path="../breaking-changes/TypeScript 1.8.html">
            
                <a href="../breaking-changes/TypeScript 1.8.html">
            
                    
                    TypeScript 1.8
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.7" data-path="../breaking-changes/TypeScript 1.7.html">
            
                <a href="../breaking-changes/TypeScript 1.7.html">
            
                    
                    TypeScript 1.7
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.8" data-path="../breaking-changes/TypeScript 1.6.html">
            
                <a href="../breaking-changes/TypeScript 1.6.html">
            
                    
                    TypeScript 1.6
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.9" data-path="../breaking-changes/TypeScript 1.5.html">
            
                <a href="../breaking-changes/TypeScript 1.5.html">
            
                    
                    TypeScript 1.5
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.10" data-path="../breaking-changes/TypeScript 1.4.html">
            
                <a href="../breaking-changes/TypeScript 1.4.html">
            
                    
                    TypeScript 1.4
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../.." >基础类型</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="&#x4ECB;&#x7ECD;">&#x4ECB;&#x7ECD;</h1>
<p>&#x4E3A;&#x4E86;&#x8BA9;&#x7A0B;&#x5E8F;&#x6709;&#x4EF7;&#x503C;&#xFF0C;&#x6211;&#x4EEC;&#x9700;&#x8981;&#x80FD;&#x591F;&#x5904;&#x7406;&#x6700;&#x7B80;&#x5355;&#x7684;&#x6570;&#x636E;&#x5355;&#x5143;&#xFF1A;&#x6570;&#x5B57;&#xFF0C;&#x5B57;&#x7B26;&#x4E32;&#xFF0C;&#x7ED3;&#x6784;&#x4F53;&#xFF0C;&#x5E03;&#x5C14;&#x503C;&#x7B49;&#x3002;
TypeScript&#x652F;&#x6301;&#x4E0E;JavaScript&#x51E0;&#x4E4E;&#x76F8;&#x540C;&#x7684;&#x6570;&#x636E;&#x7C7B;&#x578B;&#xFF0C;&#x6B64;&#x5916;&#x8FD8;&#x63D0;&#x4F9B;&#x4E86;&#x5B9E;&#x7528;&#x7684;&#x679A;&#x4E3E;&#x7C7B;&#x578B;&#x65B9;&#x4FBF;&#x6211;&#x4EEC;&#x4F7F;&#x7528;&#x3002;</p>
<h1 id="&#x5E03;&#x5C14;&#x503C;">&#x5E03;&#x5C14;&#x503C;</h1>
<p>&#x6700;&#x57FA;&#x672C;&#x7684;&#x6570;&#x636E;&#x7C7B;&#x578B;&#x5C31;&#x662F;&#x7B80;&#x5355;&#x7684;true/false&#x503C;&#xFF0C;&#x5728;JavaScript&#x548C;TypeScript&#x91CC;&#x53EB;&#x505A;<code>boolean</code>&#xFF08;&#x5176;&#x5B83;&#x8BED;&#x8A00;&#x4E2D;&#x4E5F;&#x4E00;&#x6837;&#xFF09;&#x3002;</p>
<pre><code class="lang-ts"><span class="hljs-keyword">let</span> isDone: <span class="hljs-built_in">boolean</span> = <span class="hljs-literal">false</span>;
</code></pre>
<h1 id="&#x6570;&#x5B57;">&#x6570;&#x5B57;</h1>
<p>&#x548C;JavaScript&#x4E00;&#x6837;&#xFF0C;TypeScript&#x91CC;&#x7684;&#x6240;&#x6709;&#x6570;&#x5B57;&#x90FD;&#x662F;&#x6D6E;&#x70B9;&#x6570;&#x3002;
&#x8FD9;&#x4E9B;&#x6D6E;&#x70B9;&#x6570;&#x7684;&#x7C7B;&#x578B;&#x662F;<code>number</code>&#x3002;
&#x9664;&#x4E86;&#x652F;&#x6301;&#x5341;&#x8FDB;&#x5236;&#x548C;&#x5341;&#x516D;&#x8FDB;&#x5236;&#x5B57;&#x9762;&#x91CF;&#xFF0C;TypeScript&#x8FD8;&#x652F;&#x6301;ECMAScript 2015&#x4E2D;&#x5F15;&#x5165;&#x7684;&#x4E8C;&#x8FDB;&#x5236;&#x548C;&#x516B;&#x8FDB;&#x5236;&#x5B57;&#x9762;&#x91CF;&#x3002;</p>
<pre><code class="lang-ts"><span class="hljs-keyword">let</span> decLiteral: <span class="hljs-built_in">number</span> = <span class="hljs-number">6</span>;
<span class="hljs-keyword">let</span> hexLiteral: <span class="hljs-built_in">number</span> = <span class="hljs-number">0xf00d</span>;
<span class="hljs-keyword">let</span> binaryLiteral: <span class="hljs-built_in">number</span> = <span class="hljs-number">0b1010</span>;
<span class="hljs-keyword">let</span> octalLiteral: <span class="hljs-built_in">number</span> = <span class="hljs-number">0o744</span>;
</code></pre>
<h1 id="&#x5B57;&#x7B26;&#x4E32;">&#x5B57;&#x7B26;&#x4E32;</h1>
<p>JavaScript&#x7A0B;&#x5E8F;&#x7684;&#x53E6;&#x4E00;&#x9879;&#x57FA;&#x672C;&#x64CD;&#x4F5C;&#x662F;&#x5904;&#x7406;&#x7F51;&#x9875;&#x6216;&#x670D;&#x52A1;&#x5668;&#x7AEF;&#x7684;&#x6587;&#x672C;&#x6570;&#x636E;&#x3002;
&#x50CF;&#x5176;&#x5B83;&#x8BED;&#x8A00;&#x91CC;&#x4E00;&#x6837;&#xFF0C;&#x6211;&#x4EEC;&#x4F7F;&#x7528;<code>string</code>&#x8868;&#x793A;&#x6587;&#x672C;&#x6570;&#x636E;&#x7C7B;&#x578B;&#x3002;
&#x548C;JavaScript&#x4E00;&#x6837;&#xFF0C;&#x53EF;&#x4EE5;&#x4F7F;&#x7528;&#x53CC;&#x5F15;&#x53F7;&#xFF08;<code>&quot;</code>&#xFF09;&#x6216;&#x5355;&#x5F15;&#x53F7;&#xFF08;<code>&apos;</code>&#xFF09;&#x8868;&#x793A;&#x5B57;&#x7B26;&#x4E32;&#x3002;</p>
<pre><code class="lang-ts"><span class="hljs-keyword">let</span> name: <span class="hljs-built_in">string</span> = <span class="hljs-string">&quot;bob&quot;</span>;
name = <span class="hljs-string">&quot;smith&quot;</span>;
</code></pre>
<p>&#x4F60;&#x8FD8;&#x53EF;&#x4EE5;&#x4F7F;&#x7528;<em>&#x6A21;&#x7248;&#x5B57;&#x7B26;&#x4E32;</em>&#xFF0C;&#x5B83;&#x53EF;&#x4EE5;&#x5B9A;&#x4E49;&#x591A;&#x884C;&#x6587;&#x672C;&#x548C;&#x5185;&#x5D4C;&#x8868;&#x8FBE;&#x5F0F;&#x3002;
&#x8FD9;&#x79CD;&#x5B57;&#x7B26;&#x4E32;&#x662F;&#x88AB;&#x53CD;&#x5F15;&#x53F7;&#x5305;&#x56F4;&#xFF08;<code>` </code>&#xFF09;&#xFF0C;&#x5E76;&#x4E14;&#x4EE5;<code>${ expr }</code>&#x8FD9;&#x79CD;&#x5F62;&#x5F0F;&#x5D4C;&#x5165;&#x8868;&#x8FBE;&#x5F0F;</p>
<pre><code class="lang-ts"><span class="hljs-keyword">let</span> name: <span class="hljs-built_in">string</span> = <span class="hljs-string">`Gene`</span>;
<span class="hljs-keyword">let</span> age: <span class="hljs-built_in">number</span> = <span class="hljs-number">37</span>;
<span class="hljs-keyword">let</span> sentence: <span class="hljs-built_in">string</span> = <span class="hljs-string">`Hello, my name is <span class="hljs-subst">${ name }</span>.

I&apos;ll be <span class="hljs-subst">${ age + 1 }</span> years old next month.`</span>;
</code></pre>
<p>&#x8FD9;&#x4E0E;&#x4E0B;&#x9762;&#x5B9A;&#x4E49;<code>sentence</code>&#x7684;&#x65B9;&#x5F0F;&#x6548;&#x679C;&#x76F8;&#x540C;&#xFF1A;</p>
<pre><code class="lang-ts"><span class="hljs-keyword">let</span> sentence: <span class="hljs-built_in">string</span> = <span class="hljs-string">&quot;Hello, my name is &quot;</span> + name + <span class="hljs-string">&quot;.\n\n&quot;</span> +
    <span class="hljs-string">&quot;I&apos;ll be &quot;</span> + (age + <span class="hljs-number">1</span>) + <span class="hljs-string">&quot; years old next month.&quot;</span>;
</code></pre>
<h1 id="&#x6570;&#x7EC4;">&#x6570;&#x7EC4;</h1>
<p>TypeScript&#x50CF;JavaScript&#x4E00;&#x6837;&#x53EF;&#x4EE5;&#x64CD;&#x4F5C;&#x6570;&#x7EC4;&#x5143;&#x7D20;&#x3002;
&#x6709;&#x4E24;&#x79CD;&#x65B9;&#x5F0F;&#x53EF;&#x4EE5;&#x5B9A;&#x4E49;&#x6570;&#x7EC4;&#x3002;
&#x7B2C;&#x4E00;&#x79CD;&#xFF0C;&#x53EF;&#x4EE5;&#x5728;&#x5143;&#x7D20;&#x7C7B;&#x578B;&#x540E;&#x9762;&#x63A5;&#x4E0A;<code>[]</code>&#xFF0C;&#x8868;&#x793A;&#x7531;&#x6B64;&#x7C7B;&#x578B;&#x5143;&#x7D20;&#x7EC4;&#x6210;&#x7684;&#x4E00;&#x4E2A;&#x6570;&#x7EC4;&#xFF1A;</p>
<pre><code class="lang-ts"><span class="hljs-keyword">let</span> list: <span class="hljs-built_in">number</span>[] = [<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>];
</code></pre>
<p>&#x7B2C;&#x4E8C;&#x79CD;&#x65B9;&#x5F0F;&#x662F;&#x4F7F;&#x7528;&#x6570;&#x7EC4;&#x6CDB;&#x578B;&#xFF0C;<code>Array&lt;&#x5143;&#x7D20;&#x7C7B;&#x578B;&gt;</code>&#xFF1A;</p>
<pre><code class="lang-ts"><span class="hljs-keyword">let</span> list: <span class="hljs-built_in">Array</span>&lt;<span class="hljs-built_in">number</span>&gt; = [<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>];
</code></pre>
<h1 id="&#x5143;&#x7EC4;-tuple">&#x5143;&#x7EC4; Tuple</h1>
<p>&#x5143;&#x7EC4;&#x7C7B;&#x578B;&#x5141;&#x8BB8;&#x8868;&#x793A;&#x4E00;&#x4E2A;&#x5DF2;&#x77E5;&#x5143;&#x7D20;&#x6570;&#x91CF;&#x548C;&#x7C7B;&#x578B;&#x7684;&#x6570;&#x7EC4;&#xFF0C;&#x5404;&#x5143;&#x7D20;&#x7684;&#x7C7B;&#x578B;&#x4E0D;&#x5FC5;&#x76F8;&#x540C;&#x3002;
&#x6BD4;&#x5982;&#xFF0C;&#x4F60;&#x53EF;&#x4EE5;&#x5B9A;&#x4E49;&#x4E00;&#x5BF9;&#x503C;&#x5206;&#x522B;&#x4E3A;<code>string</code>&#x548C;<code>number</code>&#x7C7B;&#x578B;&#x7684;&#x5143;&#x7EC4;&#x3002;</p>
<pre><code class="lang-ts"><span class="hljs-comment">// Declare a tuple type</span>
<span class="hljs-keyword">let</span> x: [<span class="hljs-built_in">string</span>, <span class="hljs-built_in">number</span>];
<span class="hljs-comment">// Initialize it</span>
x = [<span class="hljs-string">&apos;hello&apos;</span>, <span class="hljs-number">10</span>]; <span class="hljs-comment">// OK</span>
<span class="hljs-comment">// Initialize it incorrectly</span>
x = [<span class="hljs-number">10</span>, <span class="hljs-string">&apos;hello&apos;</span>]; <span class="hljs-comment">// Error</span>
</code></pre>
<p>&#x5F53;&#x8BBF;&#x95EE;&#x4E00;&#x4E2A;&#x5DF2;&#x77E5;&#x7D22;&#x5F15;&#x7684;&#x5143;&#x7D20;&#xFF0C;&#x4F1A;&#x5F97;&#x5230;&#x6B63;&#x786E;&#x7684;&#x7C7B;&#x578B;&#xFF1A;</p>
<pre><code class="lang-ts"><span class="hljs-built_in">console</span>.log(x[<span class="hljs-number">0</span>].substr(<span class="hljs-number">1</span>)); <span class="hljs-comment">// OK</span>
<span class="hljs-built_in">console</span>.log(x[<span class="hljs-number">1</span>].substr(<span class="hljs-number">1</span>)); <span class="hljs-comment">// Error, &apos;number&apos; does not have &apos;substr&apos;</span>
</code></pre>
<p>&#x5F53;&#x8BBF;&#x95EE;&#x4E00;&#x4E2A;&#x8D8A;&#x754C;&#x7684;&#x5143;&#x7D20;&#xFF0C;&#x4F1A;&#x4F7F;&#x7528;&#x8054;&#x5408;&#x7C7B;&#x578B;&#x66FF;&#x4EE3;&#xFF1A;</p>
<pre><code class="lang-ts">x[<span class="hljs-number">3</span>] = <span class="hljs-string">&apos;world&apos;</span>; <span class="hljs-comment">// OK, &#x5B57;&#x7B26;&#x4E32;&#x53EF;&#x4EE5;&#x8D4B;&#x503C;&#x7ED9;(string | number)&#x7C7B;&#x578B;</span>

<span class="hljs-built_in">console</span>.log(x[<span class="hljs-number">5</span>].toString()); <span class="hljs-comment">// OK, &apos;string&apos; &#x548C; &apos;number&apos; &#x90FD;&#x6709; toString</span>

x[<span class="hljs-number">6</span>] = <span class="hljs-literal">true</span>; <span class="hljs-comment">// Error, &#x5E03;&#x5C14;&#x4E0D;&#x662F;(string | number)&#x7C7B;&#x578B;</span>
</code></pre>
<p>&#x8054;&#x5408;&#x7C7B;&#x578B;&#x662F;&#x9AD8;&#x7EA7;&#x4E3B;&#x9898;&#xFF0C;&#x6211;&#x4EEC;&#x4F1A;&#x5728;&#x4EE5;&#x540E;&#x7684;&#x7AE0;&#x8282;&#x91CC;&#x8BA8;&#x8BBA;&#x5B83;&#x3002;</p>
<h1 id="&#x679A;&#x4E3E;">&#x679A;&#x4E3E;</h1>
<p><code>enum</code>&#x7C7B;&#x578B;&#x662F;&#x5BF9;JavaScript&#x6807;&#x51C6;&#x6570;&#x636E;&#x7C7B;&#x578B;&#x7684;&#x4E00;&#x4E2A;&#x8865;&#x5145;&#x3002;
&#x50CF;C#&#x7B49;&#x5176;&#x5B83;&#x8BED;&#x8A00;&#x4E00;&#x6837;&#xFF0C;&#x4F7F;&#x7528;&#x679A;&#x4E3E;&#x7C7B;&#x578B;&#x53EF;&#x4EE5;&#x4E3A;&#x4E00;&#x7EC4;&#x6570;&#x503C;&#x8D4B;&#x4E88;&#x53CB;&#x597D;&#x7684;&#x540D;&#x5B57;&#x3002;</p>
<pre><code class="lang-ts"><span class="hljs-keyword">enum</span> Color {Red, Green, Blue}
<span class="hljs-keyword">let</span> c: Color = Color.Green;
</code></pre>
<p>&#x9ED8;&#x8BA4;&#x60C5;&#x51B5;&#x4E0B;&#xFF0C;&#x4ECE;<code>0</code>&#x5F00;&#x59CB;&#x4E3A;&#x5143;&#x7D20;&#x7F16;&#x53F7;&#x3002;
&#x4F60;&#x4E5F;&#x53EF;&#x4EE5;&#x624B;&#x52A8;&#x7684;&#x6307;&#x5B9A;&#x6210;&#x5458;&#x7684;&#x6570;&#x503C;&#x3002;
&#x4F8B;&#x5982;&#xFF0C;&#x6211;&#x4EEC;&#x5C06;&#x4E0A;&#x9762;&#x7684;&#x4F8B;&#x5B50;&#x6539;&#x6210;&#x4ECE;<code>1</code>&#x5F00;&#x59CB;&#x7F16;&#x53F7;&#xFF1A;</p>
<pre><code class="lang-ts"><span class="hljs-keyword">enum</span> Color {Red = <span class="hljs-number">1</span>, Green, Blue}
<span class="hljs-keyword">let</span> c: Color = Color.Green;
</code></pre>
<p>&#x6216;&#x8005;&#xFF0C;&#x5168;&#x90E8;&#x90FD;&#x91C7;&#x7528;&#x624B;&#x52A8;&#x8D4B;&#x503C;&#xFF1A;</p>
<pre><code class="lang-ts"><span class="hljs-keyword">enum</span> Color {Red = <span class="hljs-number">1</span>, Green = <span class="hljs-number">2</span>, Blue = <span class="hljs-number">4</span>}
<span class="hljs-keyword">let</span> c: Color = Color.Green;
</code></pre>
<p>&#x679A;&#x4E3E;&#x7C7B;&#x578B;&#x63D0;&#x4F9B;&#x7684;&#x4E00;&#x4E2A;&#x4FBF;&#x5229;&#x662F;&#x4F60;&#x53EF;&#x4EE5;&#x7531;&#x679A;&#x4E3E;&#x7684;&#x503C;&#x5F97;&#x5230;&#x5B83;&#x7684;&#x540D;&#x5B57;&#x3002;
&#x4F8B;&#x5982;&#xFF0C;&#x6211;&#x4EEC;&#x77E5;&#x9053;&#x6570;&#x503C;&#x4E3A;2&#xFF0C;&#x4F46;&#x662F;&#x4E0D;&#x786E;&#x5B9A;&#x5B83;&#x6620;&#x5C04;&#x5230;Color&#x91CC;&#x7684;&#x54EA;&#x4E2A;&#x540D;&#x5B57;&#xFF0C;&#x6211;&#x4EEC;&#x53EF;&#x4EE5;&#x67E5;&#x627E;&#x76F8;&#x5E94;&#x7684;&#x540D;&#x5B57;&#xFF1A;</p>
<pre><code class="lang-ts"><span class="hljs-keyword">enum</span> Color {Red = <span class="hljs-number">1</span>, Green, Blue}
<span class="hljs-keyword">let</span> colorName: <span class="hljs-built_in">string</span> = Color[<span class="hljs-number">2</span>];

<span class="hljs-built_in">console</span>.log(colorName);  <span class="hljs-comment">// &#x663E;&#x793A;&apos;Green&apos;&#x56E0;&#x4E3A;&#x4E0A;&#x9762;&#x4EE3;&#x7801;&#x91CC;&#x5B83;&#x7684;&#x503C;&#x662F;2</span>
</code></pre>
<h1 id="&#x4EFB;&#x610F;&#x503C;">&#x4EFB;&#x610F;&#x503C;</h1>
<p>&#x6709;&#x65F6;&#x5019;&#xFF0C;&#x6211;&#x4EEC;&#x4F1A;&#x60F3;&#x8981;&#x4E3A;&#x90A3;&#x4E9B;&#x5728;&#x7F16;&#x7A0B;&#x9636;&#x6BB5;&#x8FD8;&#x4E0D;&#x6E05;&#x695A;&#x7C7B;&#x578B;&#x7684;&#x53D8;&#x91CF;&#x6307;&#x5B9A;&#x4E00;&#x4E2A;&#x7C7B;&#x578B;&#x3002;
&#x8FD9;&#x4E9B;&#x503C;&#x53EF;&#x80FD;&#x6765;&#x81EA;&#x4E8E;&#x52A8;&#x6001;&#x7684;&#x5185;&#x5BB9;&#xFF0C;&#x6BD4;&#x5982;&#x6765;&#x81EA;&#x7528;&#x6237;&#x8F93;&#x5165;&#x6216;&#x7B2C;&#x4E09;&#x65B9;&#x4EE3;&#x7801;&#x5E93;&#x3002;
&#x8FD9;&#x79CD;&#x60C5;&#x51B5;&#x4E0B;&#xFF0C;&#x6211;&#x4EEC;&#x4E0D;&#x5E0C;&#x671B;&#x7C7B;&#x578B;&#x68C0;&#x67E5;&#x5668;&#x5BF9;&#x8FD9;&#x4E9B;&#x503C;&#x8FDB;&#x884C;&#x68C0;&#x67E5;&#x800C;&#x662F;&#x76F4;&#x63A5;&#x8BA9;&#x5B83;&#x4EEC;&#x901A;&#x8FC7;&#x7F16;&#x8BD1;&#x9636;&#x6BB5;&#x7684;&#x68C0;&#x67E5;&#x3002;
&#x90A3;&#x4E48;&#x6211;&#x4EEC;&#x53EF;&#x4EE5;&#x4F7F;&#x7528;<code>any</code>&#x7C7B;&#x578B;&#x6765;&#x6807;&#x8BB0;&#x8FD9;&#x4E9B;&#x53D8;&#x91CF;&#xFF1A;</p>
<pre><code class="lang-ts"><span class="hljs-keyword">let</span> notSure: <span class="hljs-built_in">any</span> = <span class="hljs-number">4</span>;
notSure = <span class="hljs-string">&quot;maybe a string instead&quot;</span>;
notSure = <span class="hljs-literal">false</span>; <span class="hljs-comment">// okay, definitely a boolean</span>
</code></pre>
<p>&#x5728;&#x5BF9;&#x73B0;&#x6709;&#x4EE3;&#x7801;&#x8FDB;&#x884C;&#x6539;&#x5199;&#x7684;&#x65F6;&#x5019;&#xFF0C;<code>any</code>&#x7C7B;&#x578B;&#x662F;&#x5341;&#x5206;&#x6709;&#x7528;&#x7684;&#xFF0C;&#x5B83;&#x5141;&#x8BB8;&#x4F60;&#x5728;&#x7F16;&#x8BD1;&#x65F6;&#x53EF;&#x9009;&#x62E9;&#x5730;&#x5305;&#x542B;&#x6216;&#x79FB;&#x9664;&#x7C7B;&#x578B;&#x68C0;&#x67E5;&#x3002;
&#x4F60;&#x53EF;&#x80FD;&#x8BA4;&#x4E3A;<code>Object</code>&#x6709;&#x76F8;&#x4F3C;&#x7684;&#x4F5C;&#x7528;&#xFF0C;&#x5C31;&#x50CF;&#x5B83;&#x5728;&#x5176;&#x5B83;&#x8BED;&#x8A00;&#x4E2D;&#x90A3;&#x6837;&#x3002;
&#x4F46;&#x662F;<code>Object</code>&#x7C7B;&#x578B;&#x7684;&#x53D8;&#x91CF;&#x53EA;&#x662F;&#x5141;&#x8BB8;&#x4F60;&#x7ED9;&#x5B83;&#x8D4B;&#x4EFB;&#x610F;&#x503C; - &#x4F46;&#x662F;&#x5374;&#x4E0D;&#x80FD;&#x591F;&#x5728;&#x5B83;&#x4E0A;&#x9762;&#x8C03;&#x7528;&#x4EFB;&#x610F;&#x7684;&#x65B9;&#x6CD5;&#xFF0C;&#x5373;&#x4FBF;&#x5B83;&#x771F;&#x7684;&#x6709;&#x8FD9;&#x4E9B;&#x65B9;&#x6CD5;&#xFF1A;</p>
<pre><code class="lang-ts"><span class="hljs-keyword">let</span> notSure: <span class="hljs-built_in">any</span> = <span class="hljs-number">4</span>;
notSure.ifItExists(); <span class="hljs-comment">// okay, ifItExists might exist at runtime</span>
notSure.toFixed(); <span class="hljs-comment">// okay, toFixed exists (but the compiler doesn&apos;t check)</span>

<span class="hljs-keyword">let</span> prettySure: <span class="hljs-built_in">Object</span> = <span class="hljs-number">4</span>;
prettySure.toFixed(); <span class="hljs-comment">// Error: Property &apos;toFixed&apos; doesn&apos;t exist on type &apos;Object&apos;.</span>
</code></pre>
<p>&#x5F53;&#x4F60;&#x53EA;&#x77E5;&#x9053;&#x4E00;&#x90E8;&#x5206;&#x6570;&#x636E;&#x7684;&#x7C7B;&#x578B;&#x65F6;&#xFF0C;<code>any</code>&#x7C7B;&#x578B;&#x4E5F;&#x662F;&#x6709;&#x7528;&#x7684;&#x3002;
&#x6BD4;&#x5982;&#xFF0C;&#x4F60;&#x6709;&#x4E00;&#x4E2A;&#x6570;&#x7EC4;&#xFF0C;&#x5B83;&#x5305;&#x542B;&#x4E86;&#x4E0D;&#x540C;&#x7684;&#x7C7B;&#x578B;&#x7684;&#x6570;&#x636E;&#xFF1A;</p>
<pre><code class="lang-ts"><span class="hljs-keyword">let</span> list: <span class="hljs-built_in">any</span>[] = [<span class="hljs-number">1</span>, <span class="hljs-literal">true</span>, <span class="hljs-string">&quot;free&quot;</span>];

list[<span class="hljs-number">1</span>] = <span class="hljs-number">100</span>;
</code></pre>
<h1 id="&#x7A7A;&#x503C;">&#x7A7A;&#x503C;</h1>
<p>&#x67D0;&#x79CD;&#x7A0B;&#x5EA6;&#x4E0A;&#x6765;&#x8BF4;&#xFF0C;<code>void</code>&#x7C7B;&#x578B;&#x50CF;&#x662F;&#x4E0E;<code>any</code>&#x7C7B;&#x578B;&#x76F8;&#x53CD;&#xFF0C;&#x5B83;&#x8868;&#x793A;&#x6CA1;&#x6709;&#x4EFB;&#x4F55;&#x7C7B;&#x578B;&#x3002;
&#x5F53;&#x4E00;&#x4E2A;&#x51FD;&#x6570;&#x6CA1;&#x6709;&#x8FD4;&#x56DE;&#x503C;&#x65F6;&#xFF0C;&#x4F60;&#x901A;&#x5E38;&#x4F1A;&#x89C1;&#x5230;&#x5176;&#x8FD4;&#x56DE;&#x503C;&#x7C7B;&#x578B;&#x662F;<code>void</code>&#xFF1A;</p>
<pre><code class="lang-ts"><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">warnUser</span>(<span class="hljs-params"></span>): <span class="hljs-title">void</span> </span>{
    <span class="hljs-built_in">console</span>.log(<span class="hljs-string">&quot;This is my warning message&quot;</span>);
}
</code></pre>
<p>&#x58F0;&#x660E;&#x4E00;&#x4E2A;<code>void</code>&#x7C7B;&#x578B;&#x7684;&#x53D8;&#x91CF;&#x6CA1;&#x6709;&#x4EC0;&#x4E48;&#x5927;&#x7528;&#xFF0C;&#x56E0;&#x4E3A;&#x4F60;&#x53EA;&#x80FD;&#x4E3A;&#x5B83;&#x8D4B;&#x4E88;<code>undefined</code>&#x548C;<code>null</code>&#xFF1A;</p>
<pre><code class="lang-ts"><span class="hljs-keyword">let</span> unusable: <span class="hljs-built_in">void</span> = <span class="hljs-literal">undefined</span>;
</code></pre>
<h1 id="null-&#x548C;-undefined">Null &#x548C; Undefined</h1>
<p>TypeScript&#x91CC;&#xFF0C;<code>undefined</code>&#x548C;<code>null</code>&#x4E24;&#x8005;&#x5404;&#x81EA;&#x6709;&#x81EA;&#x5DF1;&#x7684;&#x7C7B;&#x578B;&#x5206;&#x522B;&#x53EB;&#x505A;<code>undefined</code>&#x548C;<code>null</code>&#x3002;
&#x548C;<code>void</code>&#x76F8;&#x4F3C;&#xFF0C;&#x5B83;&#x4EEC;&#x7684;&#x672C;&#x8EAB;&#x7684;&#x7C7B;&#x578B;&#x7528;&#x5904;&#x4E0D;&#x662F;&#x5F88;&#x5927;&#xFF1A;</p>
<pre><code class="lang-ts"><span class="hljs-comment">// Not much else we can assign to these variables!</span>
<span class="hljs-keyword">let</span> u: <span class="hljs-literal">undefined</span> = <span class="hljs-literal">undefined</span>;
<span class="hljs-keyword">let</span> n: <span class="hljs-literal">null</span> = <span class="hljs-literal">null</span>;
</code></pre>
<p>&#x9ED8;&#x8BA4;&#x60C5;&#x51B5;&#x4E0B;<code>null</code>&#x548C;<code>undefined</code>&#x662F;&#x6240;&#x6709;&#x7C7B;&#x578B;&#x7684;&#x5B50;&#x7C7B;&#x578B;&#x3002;
&#x5C31;&#x662F;&#x8BF4;&#x4F60;&#x53EF;&#x4EE5;&#x628A;<code>null</code>&#x548C;<code>undefined</code>&#x8D4B;&#x503C;&#x7ED9;<code>number</code>&#x7C7B;&#x578B;&#x7684;&#x53D8;&#x91CF;&#x3002;</p>
<p>&#x7136;&#x800C;&#xFF0C;&#x5F53;&#x4F60;&#x6307;&#x5B9A;&#x4E86;<code>--strictNullChecks</code>&#x6807;&#x8BB0;&#xFF0C;<code>null</code>&#x548C;<code>undefined</code>&#x53EA;&#x80FD;&#x8D4B;&#x503C;&#x7ED9;<code>void</code>&#x548C;&#x5B83;&#x4EEC;&#x5404;&#x81EA;&#x3002;
&#x8FD9;&#x80FD;&#x907F;&#x514D;<em>&#x5F88;&#x591A;</em>&#x5E38;&#x89C1;&#x7684;&#x95EE;&#x9898;&#x3002;
&#x4E5F;&#x8BB8;&#x5728;&#x67D0;&#x5904;&#x4F60;&#x60F3;&#x4F20;&#x5165;&#x4E00;&#x4E2A;<code>string</code>&#x6216;<code>null</code>&#x6216;<code>undefined</code>&#xFF0C;&#x4F60;&#x53EF;&#x4EE5;&#x4F7F;&#x7528;&#x8054;&#x5408;&#x7C7B;&#x578B;<code>string | null | undefined</code>&#x3002;
&#x518D;&#x6B21;&#x8BF4;&#x660E;&#xFF0C;&#x7A0D;&#x540E;&#x6211;&#x4EEC;&#x4F1A;&#x4ECB;&#x7ECD;&#x8054;&#x5408;&#x7C7B;&#x578B;&#x3002;</p>
<blockquote>
<p>&#x6CE8;&#x610F;&#xFF1A;&#x6211;&#x4EEC;&#x9F13;&#x52B1;&#x5C3D;&#x53EF;&#x80FD;&#x5730;&#x4F7F;&#x7528;<code>--strictNullChecks</code>&#xFF0C;&#x4F46;&#x5728;&#x672C;&#x624B;&#x518C;&#x91CC;&#x6211;&#x4EEC;&#x5047;&#x8BBE;&#x8FD9;&#x4E2A;&#x6807;&#x8BB0;&#x662F;&#x5173;&#x95ED;&#x7684;&#x3002;</p>
</blockquote>
<h1 id="never">Never</h1>
<p><code>never</code>&#x7C7B;&#x578B;&#x8868;&#x793A;&#x7684;&#x662F;&#x90A3;&#x4E9B;&#x6C38;&#x4E0D;&#x5B58;&#x5728;&#x7684;&#x503C;&#x7684;&#x7C7B;&#x578B;&#x3002;
&#x4F8B;&#x5982;&#xFF0C;<code>never</code>&#x7C7B;&#x578B;&#x662F;&#x90A3;&#x4E9B;&#x603B;&#x662F;&#x4F1A;&#x629B;&#x51FA;&#x5F02;&#x5E38;&#x6216;&#x6839;&#x672C;&#x5C31;&#x4E0D;&#x4F1A;&#x6709;&#x8FD4;&#x56DE;&#x503C;&#x7684;&#x51FD;&#x6570;&#x8868;&#x8FBE;&#x5F0F;&#x6216;&#x7BAD;&#x5934;&#x51FD;&#x6570;&#x8868;&#x8FBE;&#x5F0F;&#x7684;&#x8FD4;&#x56DE;&#x503C;&#x7C7B;&#x578B;&#xFF1B;
&#x53D8;&#x91CF;&#x4E5F;&#x53EF;&#x80FD;&#x662F;<code>never</code>&#x7C7B;&#x578B;&#xFF0C;&#x5F53;&#x5B83;&#x4EEC;&#x88AB;&#x6C38;&#x4E0D;&#x4E3A;&#x771F;&#x7684;&#x7C7B;&#x578B;&#x4FDD;&#x62A4;&#x6240;&#x7EA6;&#x675F;&#x65F6;&#x3002;</p>
<p><code>never</code>&#x7C7B;&#x578B;&#x662F;&#x4EFB;&#x4F55;&#x7C7B;&#x578B;&#x7684;&#x5B50;&#x7C7B;&#x578B;&#xFF0C;&#x4E5F;&#x53EF;&#x4EE5;&#x8D4B;&#x503C;&#x7ED9;&#x4EFB;&#x4F55;&#x7C7B;&#x578B;&#xFF1B;&#x7136;&#x800C;&#xFF0C;<em>&#x6CA1;&#x6709;</em>&#x7C7B;&#x578B;&#x662F;<code>never</code>&#x7684;&#x5B50;&#x7C7B;&#x578B;&#x6216;&#x53EF;&#x4EE5;&#x8D4B;&#x503C;&#x7ED9;<code>never</code>&#x7C7B;&#x578B;&#xFF08;&#x9664;&#x4E86;<code>never</code>&#x672C;&#x8EAB;&#x4E4B;&#x5916;&#xFF09;&#x3002;
&#x5373;&#x4F7F;<code>any</code>&#x4E5F;&#x4E0D;&#x53EF;&#x4EE5;&#x8D4B;&#x503C;&#x7ED9;<code>never</code>&#x3002;</p>
<p>&#x4E0B;&#x9762;&#x662F;&#x4E00;&#x4E9B;&#x8FD4;&#x56DE;<code>never</code>&#x7C7B;&#x578B;&#x7684;&#x51FD;&#x6570;&#xFF1A;</p>
<pre><code class="lang-ts"><span class="hljs-comment">// &#x8FD4;&#x56DE;never&#x7684;&#x51FD;&#x6570;&#x5FC5;&#x987B;&#x5B58;&#x5728;&#x65E0;&#x6CD5;&#x8FBE;&#x5230;&#x7684;&#x7EC8;&#x70B9;</span>
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">error</span>(<span class="hljs-params">message: <span class="hljs-built_in">string</span></span>): <span class="hljs-title">never</span> </span>{
    <span class="hljs-keyword">throw</span> <span class="hljs-keyword">new</span> <span class="hljs-built_in">Error</span>(message);
}

<span class="hljs-comment">// &#x63A8;&#x65AD;&#x7684;&#x8FD4;&#x56DE;&#x503C;&#x7C7B;&#x578B;&#x4E3A;never</span>
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">fail</span>(<span class="hljs-params"></span>) </span>{
    <span class="hljs-keyword">return</span> error(<span class="hljs-string">&quot;Something failed&quot;</span>);
}

<span class="hljs-comment">// &#x8FD4;&#x56DE;never&#x7684;&#x51FD;&#x6570;&#x5FC5;&#x987B;&#x5B58;&#x5728;&#x65E0;&#x6CD5;&#x8FBE;&#x5230;&#x7684;&#x7EC8;&#x70B9;</span>
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">infiniteLoop</span>(<span class="hljs-params"></span>): <span class="hljs-title">never</span> </span>{
    <span class="hljs-keyword">while</span> (<span class="hljs-literal">true</span>) {
    }
}
</code></pre>
<h1 id="object">Object</h1>
<p><code>object</code>&#x8868;&#x793A;&#x975E;&#x539F;&#x59CB;&#x7C7B;&#x578B;&#xFF0C;&#x4E5F;&#x5C31;&#x662F;&#x9664;<code>number</code>&#xFF0C;<code>string</code>&#xFF0C;<code>boolean</code>&#xFF0C;<code>symbol</code>&#xFF0C;<code>null</code>&#x6216;<code>undefined</code>&#x4E4B;&#x5916;&#x7684;&#x7C7B;&#x578B;&#x3002;</p>
<p>&#x4F7F;&#x7528;<code>object</code>&#x7C7B;&#x578B;&#xFF0C;&#x5C31;&#x53EF;&#x4EE5;&#x66F4;&#x597D;&#x7684;&#x8868;&#x793A;&#x50CF;<code>Object.create</code>&#x8FD9;&#x6837;&#x7684;API&#x3002;&#x4F8B;&#x5982;&#xFF1A;</p>
<pre><code class="lang-ts"><span class="hljs-keyword">declare</span> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">create</span>(<span class="hljs-params">o: object | <span class="hljs-literal">null</span></span>): <span class="hljs-title">void</span></span>;

create({ prop: <span class="hljs-number">0</span> }); <span class="hljs-comment">// OK</span>
create(<span class="hljs-literal">null</span>); <span class="hljs-comment">// OK</span>

create(<span class="hljs-number">42</span>); <span class="hljs-comment">// Error</span>
create(<span class="hljs-string">&quot;string&quot;</span>); <span class="hljs-comment">// Error</span>
create(<span class="hljs-literal">false</span>); <span class="hljs-comment">// Error</span>
create(<span class="hljs-literal">undefined</span>); <span class="hljs-comment">// Error</span>
</code></pre>
<h1 id="&#x7C7B;&#x578B;&#x65AD;&#x8A00;">&#x7C7B;&#x578B;&#x65AD;&#x8A00;</h1>
<p>&#x6709;&#x65F6;&#x5019;&#x4F60;&#x4F1A;&#x9047;&#x5230;&#x8FD9;&#x6837;&#x7684;&#x60C5;&#x51B5;&#xFF0C;&#x4F60;&#x4F1A;&#x6BD4;TypeScript&#x66F4;&#x4E86;&#x89E3;&#x67D0;&#x4E2A;&#x503C;&#x7684;&#x8BE6;&#x7EC6;&#x4FE1;&#x606F;&#x3002;
&#x901A;&#x5E38;&#x8FD9;&#x4F1A;&#x53D1;&#x751F;&#x5728;&#x4F60;&#x6E05;&#x695A;&#x5730;&#x77E5;&#x9053;&#x4E00;&#x4E2A;&#x5B9E;&#x4F53;&#x5177;&#x6709;&#x6BD4;&#x5B83;&#x73B0;&#x6709;&#x7C7B;&#x578B;&#x66F4;&#x786E;&#x5207;&#x7684;&#x7C7B;&#x578B;&#x3002;</p>
<p>&#x901A;&#x8FC7;<em>&#x7C7B;&#x578B;&#x65AD;&#x8A00;</em>&#x8FD9;&#x79CD;&#x65B9;&#x5F0F;&#x53EF;&#x4EE5;&#x544A;&#x8BC9;&#x7F16;&#x8BD1;&#x5668;&#xFF0C;&#x201C;&#x76F8;&#x4FE1;&#x6211;&#xFF0C;&#x6211;&#x77E5;&#x9053;&#x81EA;&#x5DF1;&#x5728;&#x5E72;&#x4EC0;&#x4E48;&#x201D;&#x3002;
&#x7C7B;&#x578B;&#x65AD;&#x8A00;&#x597D;&#x6BD4;&#x5176;&#x5B83;&#x8BED;&#x8A00;&#x91CC;&#x7684;&#x7C7B;&#x578B;&#x8F6C;&#x6362;&#xFF0C;&#x4F46;&#x662F;&#x4E0D;&#x8FDB;&#x884C;&#x7279;&#x6B8A;&#x7684;&#x6570;&#x636E;&#x68C0;&#x67E5;&#x548C;&#x89E3;&#x6784;&#x3002;
&#x5B83;&#x6CA1;&#x6709;&#x8FD0;&#x884C;&#x65F6;&#x7684;&#x5F71;&#x54CD;&#xFF0C;&#x53EA;&#x662F;&#x5728;&#x7F16;&#x8BD1;&#x9636;&#x6BB5;&#x8D77;&#x4F5C;&#x7528;&#x3002;
TypeScript&#x4F1A;&#x5047;&#x8BBE;&#x4F60;&#xFF0C;&#x7A0B;&#x5E8F;&#x5458;&#xFF0C;&#x5DF2;&#x7ECF;&#x8FDB;&#x884C;&#x4E86;&#x5FC5;&#x987B;&#x7684;&#x68C0;&#x67E5;&#x3002;</p>
<p>&#x7C7B;&#x578B;&#x65AD;&#x8A00;&#x6709;&#x4E24;&#x79CD;&#x5F62;&#x5F0F;&#x3002;
&#x5176;&#x4E00;&#x662F;&#x201C;&#x5C16;&#x62EC;&#x53F7;&#x201D;&#x8BED;&#x6CD5;&#xFF1A;</p>
<pre><code class="lang-ts"><span class="hljs-keyword">let</span> someValue: <span class="hljs-built_in">any</span> = <span class="hljs-string">&quot;this is a string&quot;</span>;

<span class="hljs-keyword">let</span> strLength: <span class="hljs-built_in">number</span> = (&lt;<span class="hljs-built_in">string</span>&gt;someValue).length;
</code></pre>
<p>&#x53E6;&#x4E00;&#x4E2A;&#x4E3A;<code>as</code>&#x8BED;&#x6CD5;&#xFF1A;</p>
<pre><code class="lang-ts"><span class="hljs-keyword">let</span> someValue: <span class="hljs-built_in">any</span> = <span class="hljs-string">&quot;this is a string&quot;</span>;

<span class="hljs-keyword">let</span> strLength: <span class="hljs-built_in">number</span> = (someValue as <span class="hljs-built_in">string</span>).length;
</code></pre>
<p>&#x4E24;&#x79CD;&#x5F62;&#x5F0F;&#x662F;&#x7B49;&#x4EF7;&#x7684;&#x3002;
&#x81F3;&#x4E8E;&#x4F7F;&#x7528;&#x54EA;&#x4E2A;&#x5927;&#x591A;&#x6570;&#x60C5;&#x51B5;&#x4E0B;&#x662F;&#x51ED;&#x4E2A;&#x4EBA;&#x559C;&#x597D;&#xFF1B;&#x7136;&#x800C;&#xFF0C;&#x5F53;&#x4F60;&#x5728;TypeScript&#x91CC;&#x4F7F;&#x7528;JSX&#x65F6;&#xFF0C;&#x53EA;&#x6709;<code>as</code>&#x8BED;&#x6CD5;&#x65AD;&#x8A00;&#x662F;&#x88AB;&#x5141;&#x8BB8;&#x7684;&#x3002;</p>
<h1 id="&#x5173;&#x4E8E;let">&#x5173;&#x4E8E;<code>let</code></h1>
<p>&#x4F60;&#x53EF;&#x80FD;&#x5DF2;&#x7ECF;&#x6CE8;&#x610F;&#x5230;&#x4E86;&#xFF0C;&#x6211;&#x4EEC;&#x4F7F;&#x7528;<code>let</code>&#x5173;&#x952E;&#x5B57;&#x6765;&#x4EE3;&#x66FF;&#x5927;&#x5BB6;&#x6240;&#x719F;&#x6089;&#x7684;JavaScript&#x5173;&#x952E;&#x5B57;<code>var</code>&#x3002;
<code>let</code>&#x5173;&#x952E;&#x5B57;&#x662F;JavaScript&#x7684;&#x4E00;&#x4E2A;&#x65B0;&#x6982;&#x5FF5;&#xFF0C;TypeScript&#x5B9E;&#x73B0;&#x4E86;&#x5B83;&#x3002;
&#x6211;&#x4EEC;&#x4F1A;&#x5728;&#x4EE5;&#x540E;&#x8BE6;&#x7EC6;&#x4ECB;&#x7ECD;&#x5B83;&#xFF0C;&#x5F88;&#x591A;&#x5E38;&#x89C1;&#x7684;&#x95EE;&#x9898;&#x90FD;&#x53EF;&#x4EE5;&#x901A;&#x8FC7;&#x4F7F;&#x7528;<code>let</code>&#x6765;&#x89E3;&#x51B3;&#xFF0C;&#x6240;&#x4EE5;&#x5C3D;&#x53EF;&#x80FD;&#x5730;&#x4F7F;&#x7528;<code>let</code>&#x6765;&#x4EE3;&#x66FF;<code>var</code>&#x5427;&#x3002;</p>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="./" class="navigation navigation-prev " aria-label="Previous page: 手册">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="Variable Declarations.html" class="navigation navigation-next " aria-label="Next page: 变量声明">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"基础类型","level":"1.3.1","depth":2,"next":{"title":"变量声明","level":"1.3.2","depth":2,"path":"doc/handbook/Variable Declarations.md","ref":"./doc/handbook/Variable Declarations.md","articles":[]},"previous":{"title":"手册","level":"1.3","depth":1,"path":"doc/handbook/README.md","ref":"./doc/handbook/README.md","articles":[{"title":"基础类型","level":"1.3.1","depth":2,"path":"doc/handbook/Basic Types.md","ref":"./doc/handbook/Basic Types.md","articles":[]},{"title":"变量声明","level":"1.3.2","depth":2,"path":"doc/handbook/Variable Declarations.md","ref":"./doc/handbook/Variable Declarations.md","articles":[]},{"title":"接口","level":"1.3.3","depth":2,"path":"doc/handbook/Interfaces.md","ref":"./doc/handbook/Interfaces.md","articles":[]},{"title":"类","level":"1.3.4","depth":2,"path":"doc/handbook/Classes.md","ref":"./doc/handbook/Classes.md","articles":[]},{"title":"函数","level":"1.3.5","depth":2,"path":"doc/handbook/Functions.md","ref":"./doc/handbook/Functions.md","articles":[]},{"title":"泛型","level":"1.3.6","depth":2,"path":"doc/handbook/Generics.md","ref":"./doc/handbook/Generics.md","articles":[]},{"title":"枚举","level":"1.3.7","depth":2,"path":"doc/handbook/Enums.md","ref":"./doc/handbook/Enums.md","articles":[]},{"title":"类型推论","level":"1.3.8","depth":2,"path":"doc/handbook/Type Inference.md","ref":"./doc/handbook/Type Inference.md","articles":[]},{"title":"类型兼容性","level":"1.3.9","depth":2,"path":"doc/handbook/Type Compatibility.md","ref":"./doc/handbook/Type Compatibility.md","articles":[]},{"title":"高级类型","level":"1.3.10","depth":2,"path":"doc/handbook/Advanced Types.md","ref":"./doc/handbook/Advanced Types.md","articles":[]},{"title":"实用工具类型","level":"1.3.11","depth":2,"path":"doc/handbook/Utilit Types.md","ref":"./doc/handbook/Utilit Types.md","articles":[]},{"title":"Symbols","level":"1.3.12","depth":2,"path":"doc/handbook/Symbols.md","ref":"./doc/handbook/Symbols.md","articles":[]},{"title":"Iterators 和 Generators","level":"1.3.13","depth":2,"path":"doc/handbook/Iterators and Generators.md","ref":"./doc/handbook/Iterators and Generators.md","articles":[]},{"title":"模块","level":"1.3.14","depth":2,"path":"doc/handbook/Modules.md","ref":"./doc/handbook/Modules.md","articles":[]},{"title":"命名空间","level":"1.3.15","depth":2,"path":"doc/handbook/Namespaces.md","ref":"./doc/handbook/Namespaces.md","articles":[]},{"title":"命名空间和模块","level":"1.3.16","depth":2,"path":"doc/handbook/Namespaces and Modules.md","ref":"./doc/handbook/Namespaces and Modules.md","articles":[]},{"title":"模块解析","level":"1.3.17","depth":2,"path":"doc/handbook/Module Resolution.md","ref":"./doc/handbook/Module Resolution.md","articles":[]},{"title":"声明合并","level":"1.3.18","depth":2,"path":"doc/handbook/Declaration Merging.md","ref":"./doc/handbook/Declaration Merging.md","articles":[]},{"title":"书写.d.ts文件","level":"1.3.19","depth":2,"path":"doc/handbook/Writing Definition Files.md","ref":"./doc/handbook/Writing Definition Files.md","articles":[]},{"title":"JSX","level":"1.3.20","depth":2,"path":"doc/handbook/JSX.md","ref":"./doc/handbook/JSX.md","articles":[]},{"title":"Decorators","level":"1.3.21","depth":2,"path":"doc/handbook/Decorators.md","ref":"./doc/handbook/Decorators.md","articles":[]},{"title":"混入","level":"1.3.22","depth":2,"path":"doc/handbook/Mixins.md","ref":"./doc/handbook/Mixins.md","articles":[]},{"title":"三斜线指令","level":"1.3.23","depth":2,"path":"doc/handbook/Triple-Slash Directives.md","ref":"./doc/handbook/Triple-Slash Directives.md","articles":[]},{"title":"JavaScript文件里的类型检查","level":"1.3.24","depth":2,"path":"doc/handbook/Type Checking JavaScript Files.md","ref":"./doc/handbook/Type Checking JavaScript Files.md","articles":[]}]},"dir":"ltr"},"config":{"plugins":[],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"Patrick Zhong","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"preface.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"TypeScript Handbook","language":"zh-hans","gitbook":">3.0.0","description":"Translation of official TypeScript Handbook"},"file":{"path":"doc/handbook/Basic Types.md","mtime":"2018-10-13T09:48:54.000Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-10-13T09:57:42.904Z"},"basePath":"../..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../../gitbook/gitbook.js"></script>
    <script src="../../gitbook/theme.js"></script>
    
        
        <script src="../../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

